package made.ga;

import java.util.Comparator;

public class FitnessComparatorFloat implements Comparator<ChromosomeFloat> {

	public int compare(ChromosomeFloat gene1, ChromosomeFloat gene2) {
	    float fitness1 = gene1.getFitness();
	    float fitness2 = gene2.getFitness();
	    
	    if(fitness1 > fitness2) {
	    	return -1;
	    }
	    else if(fitness1 < fitness2) {
	    	return 1;
	    }
	    else {
	    	return 0;
	    }
	}
}
